﻿#ifndef SVR_COMMON_SERVER_MAILBOX_MGR_HEAD__
#define SVR_COMMON_SERVER_MAILBOX_MGR_HEAD__

#include <cstdint>  // for uint16_t
#include <list>
#include <string>

class CCfgReader;
class CServerMailBox;

using ServerMailBoxList = std::list<CServerMailBox*>;

class CServerMailBoxMgr
{
public:
	CServerMailBoxMgr();
	virtual ~CServerMailBoxMgr();

public:
	bool init(CCfgReader& cfg);

public:
	inline ServerMailBoxList& GetSvrMailBoxes()
	{
		return m_mbs;
	}
	inline const ServerMailBoxList& GetSvrMailBoxes() const
	{
		return m_mbs;
	}

	//根据serverID拿 ip:port
	std::string  GetIpByServerID(uint16_t serverID);
	uint16_t  GetPortByServerID(uint16_t serverID);

private:
	ServerMailBoxList m_mbs;
};

#endif  // SVR_COMMON_SERVER_MAILBOX_MGR_HEAD__
